package cn.edu.cdu.farmdeal.mapper;

import cn.edu.cdu.farmdeal.domain.Cart;
import cn.edu.cdu.farmdeal.domain.CartExample;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
@Mapper

public interface CartMapper {
    /**
     * 获取cartId
     * @param userName
     * @return int
     */
    Cart getId(String userName);
    /**
     * 获得购物车的数量
     * @param userName
     * @return
     */
    int getCartNum(String userName);

    int countByExample(CartExample example);

    int deleteByExample(CartExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    int insertSelective(Cart record);

    List<Cart> selectByExample(CartExample example);

    Cart selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Cart record, @Param("example") CartExample example);

    int updateByExample(@Param("record") Cart record, @Param("example") CartExample example);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);
}